<template>
    <div>
               

          <el-table
      class="jlTable"
      style="width: 100%;"
      :header-cell-style="{ background: '#F2F2F2', color: '#333' }"
      :data="templateList"
    >
      <!-- <el-table-column type="selection" width="55"></el-table-column> -->
      <el-table-column label="序号" type="index" width="50" align="center"></el-table-column>
      <el-table-column label="任务单ID" width="200">
        <template slot-scope="scope">{{ scope.row.orderTaskId }}</template>
      </el-table-column>
      <el-table-column label="收款单位确认时间" width="200">
        <template slot-scope="scope">{{ scope.row.taskOprDate }}</template>
      </el-table-column>
      <el-table-column label="审核备注" width="200">
        <template slot-scope="scope">{{ scope.row.taskComment }}</template>
      </el-table-column>
      <el-table-column label="审核意见" width="200">
        <template slot-scope="scope">{{ scope.row.result }}</template>
      </el-table-column>
     <el-table-column label="审核人" width="200">
        <template slot-scope="scope">{{ scope.row.userName }}</template>
      </el-table-column>
   
      
    </el-table>
    <el-row type="flex" class="row-bg mar-15" justify="center">
      <el-col :span="10">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="pageChange"
          :current-page="1"
          background
          :page-sizes="[5, 10, 15, 20]"
          :total="total"
          layout="total, sizes, prev, pager, next, jumper"
        ></el-pagination>
      </el-col>
    </el-row>
    </div>
</template>
<script>
import CustOrderService from "@/api/order/CustOrderService";
export default {
  name:"收款单位确认日志",
    data(){
        return {
            filterMode:"0",
            productName:"",
            templateList:[],
            pageSize:10,
            pageIndex:0,
            total:0,

        }; 
    },
    mounted(){
      this.query();
    },
    props: {
      ODKInfo: {
        type: Object,
        default: () => {
          return {};
        },
      },
      CTOInfo: {
        type: [Object, Array],
        default: () => {
          return {};
        },
      },
    },
     methods: {
       async query(){
            var custOrder = JSON.parse(localStorage.getItem("custOrder_select"));
            var params = {
              custId:custOrder.custId,
              PayeeAPreFlag:1,
              orderItemId:this.CTOInfo.orderItemId,
              taskId:"TACHE10550001,TACHE10570001",
              "pageInfo": {
                "pageIndex": this.pageIndex,
                "pageSize": this.pageSize
               }

            };
           
            
            var result = await CustOrderService.qryOrderTaskList(params);
            
             this.templateList = result.meta.flowOrderTasks;

            var orderTasks = result.meta.orderTasks;
             this.templateList.forEach(item => {
                  var orderTask = orderTasks.filter(task=>{ return item.orderItemId == task.orderItemId});
                  item.taskComment = orderTask[0].taskComment;
                  item.result = orderTask[0].result;
                  item.taskReqDate = orderTask[0].taskReqDate;
                  item.taskOprDate = orderTask[0].taskOprDate;
                  item.userId = orderTask[0].userId;
                  item.userName = orderTask[0].userName;
             });

             this.total = result.meta.rowCount;

        },
         //页面改变触发事件
        pageChange(val) {
            
            this.pageIndex = val;
            this.query();
    
        },
        handleSizeChange(val){
            
            this.pageSize = val;
            this.query();
        },
     }
    
}
</script>
<style lang="scss">

    .el-form--inline .el-form-item {
        display: inline-flex;
        margin-right: 0.1rem;
        vertical-align: top;
        width: 100%;
    }

</style>


